<script type="text/javascript"
	src="<?php echo URL::base()?>js/ads.js"></script>
<div id="dialog-form-ads" title="广告管理"></div>
<div id="supplier-contain" class="ui-widget">
<div>
	<span>
		类别:
		<select id="categoryType" style="display: inline;" class="ui-widget-content ui-corner-all">
			<option value="type">类型</option>
			<option value="value">广告地址或商家ID</option>
			<option value="position">广告位置</option>
		</select>
	<input type="text" name="searchText" id="searchText" style="display: inline;float: none;" class="ui-widget-content ui-corner-all" value="<?php if (!empty($result_search_text)) echo $result_search_text?>"/>
	<button id="query-ads">查询</button>
	</span>
</div>
<table id="supplier" class="ui-widget ui-widget-content">
	<thead>
		<tr class="ui-widget-header ">
			<th><input type="checkbox" onclick="changeSelectAll(this,'checkKey');"></th>
			<th>类别</th>
			<th>广告地址或商家ID</th>
			<th>图片地址</th>
			<th>显示顺序</th>
			<th>广告位置</th>
			<th>备注</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
	<?php
	foreach ($result_ads as $item){
		echo '<tr><td><input type="checkbox" class="checkKey" key="'.$item->id.'"/></td>';
		echo '<td>'.$item->type.'</td>';
		echo '<td>'.$item->value.'</td>';
		echo '<td>';
		if(!empty($item->picture)){
			echo '<a target="_blank" href="'.URL::domain().ADS_IMG_PATH.$item->picture.'"><img src="'.URL::domain().ADS_IMG_PATH.$item->picture.'" width="100ps" /></a></td>';
		}
		echo '<td>'.$item->sort.'</td>';
		echo '<td>'.$item->position.'</td>';
		echo '<td>'.$item->desc.'</td>';
		echo '<td><button class="editAdsBtn" adsid="'.$item->id.'">修改</button>&nbsp;';
		echo '<button class="delAdsBtn" adsid="'.$item->id.'">删除</button></td>';
	}?>
	</tbody>
</table>
<div class="page clear"><?php echo $page_links;?></div>
<button id="create-ads">添加广告</button>
<button id="edit-ads">修改广告</button>
<button id="delete-ads">删除选中广告</button>
</div>
